Preview - From Ecosystems To Speciation

Introduction to the NetLogo Model


It is often helpful to understand how a model works before using it to investigate a phenomenon.  In this activity, you will look at and interpret some of the underlying code that governs how the model runs.  If you want to investigate beyond the questions in this activity, you can look at the complete code of any NetLogo model by clicking on the tab labeled 'NetLogo Code'.

All of the models you will see throughout this unit will have some things in common.  For example, every model has individuals called agents which interact with each other in a variety of ways based on rules that govern their behaviors.  Also, in every model, time moves forward in short steps called ticks.  At the end of each tick, the model uses the agents' rules to calculate what the state of the model will be in the next tick.  This means that to understand how the model works, it will be important to understand how the agents behave.

This model has two main types of agents, which are wolves and moose.  The questions below will address how each of them behaves. 


Questions

Please answer the questions below.

This is a segment of code from the model which governs how wolves behave.  Each wolf has an internal stash of energy, which is related to how healthy it is.

This code will be used every tick by each wolf.  The gray text is a comment describing what the line of code does,  but it has no effect on how the code works.

Think back to the rules for wolf behavior that your class created in the previous lesson.  How do you think the rules represented in this code compare to the rules you came up with?


This is a segment of code from the model which governs how moose behave.  This code will be used every tick by each moose.  It is similar to the code describing how wolves behave, but is slightly more complicated.

The model version variable can be set to either "moose-wolves" or "moose-wolves-plant".  If it is set to "moose-wolves-plant", then the model will include grass as a renewable food source for moose and the code in the following brackets (lines 57, 58, and 59) will run.  If it is set to "moose-wolves", then that code will not run.  Based on this code, what do you think will change about how moose behave if grass is included or not included?


Now you will explore the NetLogo Code tab.  Both of the pieces of code from the previous questions use a function called MAYBE-DIE.  Click on the tab below the model labeled 'NetLogo Code' and find the function called MAYBE-DIE (the first line of the function is 'to maybe-die').  How does this function work?  What would cause a wolf or moose to die?


Notes

These notes will appear on every page in this lesson so feel free to put anything here you'd like to keep track of.